package framework.filters;

import framework.pipes.PushPipe;

/**
 * 
 * @author Wetzel & Rusch
 * 
 * @param <T>
 *            Outgoing data type
 */
public abstract class AbstractPushFilter<T> implements PushFilter<T> {
	private final PushPipe<T> m_pushPipe;
	protected T m_data;

	public AbstractPushFilter(PushPipe<T> pushPipe) {
		m_pushPipe = pushPipe;
	}

	@Override
	public void push(T data) {
		m_data = data;
		doIt();
		if (m_pushPipe != null) {
			m_pushPipe.push(m_data);
		}
	}
}
